home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / lst / RCS / lstInit.c,v < prev    next >
Encoding:
Text File  |  1992-05-19  |  1.6 KB  |  84 lines

  1. head     1.7;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.7
  10. date     88.11.17.20.52.57;  author adam;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.7
  21. log
  22. @checked in with -k by kupfer at 92.05.18.17.32.40.
  23. @
  24. text
  25. @/*-
  26.  * init.c --
  27.  *    Initialize a new linked list.
  28.  *
  29.  * Copyright (c) 1988 by University of California Regents
  30.  *
  31.  * Permission to use, copy, modify, and distribute this
  32.  * software and its documentation for any purpose and without
  33.  * fee is hereby granted, provided that the above copyright
  34.  * notice appears in all copies.  Neither the University of California nor
  35.  * Adam de Boor makes any representations about the suitability of this
  36.  * software for any purpose.  It is provided "as is" without
  37.  * express or implied warranty.
  38.  */
  39. #ifndef lint
  40. static char *rcsid =
  41. "$Id: lstInit.c,v 1.7 88/11/17 20:52:57 adam Exp $ SPRITE (Berkeley)";
  42. #endif lint
  43.  
  44. #include    "lstInt.h"
  45.  
  46. /*-
  47.  *-----------------------------------------------------------------------
  48.  * Lst_Init --
  49.  *    Create and initialize a new list.
  50.  *
  51.  * Results:
  52.  *    The created list.
  53.  *
  54.  * Side Effects:
  55.  *    A list is created, what else?
  56.  *
  57.  *-----------------------------------------------------------------------
  58.  */
  59. Lst
  60. Lst_Init(circ)
  61.     Boolean        circ;    /* TRUE if the list should be made circular */
  62. {
  63.     register List    nList;
  64.     
  65.     PAlloc (nList, List);
  66.     
  67.     nList->firstPtr = NilListNode;
  68.     nList->lastPtr = NilListNode;
  69.     nList->isOpen = FALSE;
  70.     nList->isCirc = circ;
  71.     nList->atEnd = Unknown;
  72.     
  73.     return ((Lst)nList);
  74. }
  75.  
  76. Malloc(nbytes)
  77. {
  78. #ifdef DEBUG
  79.     printf("malloc: %d\n", nbytes);
  80. #endif DEBUG
  81.     return(malloc(nbytes));
  82. }
  83. @
  84.